define(['jquery','api','user'],function($,api,user){
	var vm, 
	   controller = {
	   init:function(id){
	   	   if(!user.checkLogin())return;
		   api.initFooter(2);
		   api.setTitle('交易规则');
		   if(!vm){
		     this.render();
		   }else{
		     vm.show=true;
		   }
	   },
	   render:function(){
	   	   $('#pages').append('<div id="rule"></div>');
	       require(['text!pages/article/rule.html','Vue'],function(tpl,Vue){
	            vm=new Vue({
	               el:'#rule',
	               data:{
	               	  show:true
	               },
	               template:tpl
	            })
	       })
	   },
	   onRouteChange:function(){
	       if(vm)vm.show=false;
	   }
	}
    return controller;
})